<?php
/**
 * @version     1.0.0
 * @package     com_glycophile
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Ali SAHLI <sahli28@gmail.com> - https://plus.google.com/u/0/115470606844807318192/posts
 */

// No direct access
defined('_JEXEC') or die;

/**
 * Glycophile helper.
 */
class GlycophileHelper
{
	/**
	 * Configure the Linkbar.
	 */
	public static function addSubmenu($vName = '')
	{

     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_INVENTAIRES'),
			'index.php?option=com_glycophile&view=inventaires',
			$vName == 'inventaires'
		);

     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_SUCRES'),
			'index.php?option=com_glycophile&view=sucres',
			$vName == 'sucres'
		);


    JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_SERIES'),
			'index.php?option=com_glycophile&view=series',
			$vName == 'series'
		);

     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_SOUSSERIES'),
			'index.php?option=com_glycophile&view=sousseries',
			$vName == 'sousseries'
		);

    JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_RAFFINERIES'),
			'index.php?option=com_glycophile&view=raffineries',
			$vName == 'raffineries'
		);

     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_FORM_LBL_THEME_THEMES'),
			'index.php?option=com_glycophile&view=themes',
			$vName == 'themes'
		);

     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_FORM_LBL_THEME_TOMES'),
			'index.php?option=com_glycophile&view=tomes',
			$vName == 'tomes'
		);

		JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_PAYSS'),
			'index.php?option=com_glycophile&view=payss',
			$vName == 'payss'
		);

    JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_FAMILLES'),
			'index.php?option=com_glycophile&view=familles',
			$vName == 'familles'
		);


     JSubMenuHelper::addEntry(
			JText::_('COM_GLYCOPHILE_TITLE_TYPES'),
			'index.php?option=com_glycophile&view=types',
			$vName == 'types'
		);



	}

	/**
	 * Gets a list of the actions that can be performed.
	 *
	 * @return	JObject
	 * @since	1.6
	 */
	public static function getActions()
	{
		$user	= JFactory::getUser();
		$result	= new JObject;

		$assetName = 'com_glycophile';

		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'
		);

		foreach ($actions as $action) {
			$result->set($action, $user->authorise($action, $assetName));
		}

		return $result;
	}
}
